package com.example.finalproject.order;

import com.example.finalproject.collection.Collection;
import com.example.finalproject.collection.CollectionRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderService {
    @Autowired
    private OrderRepository orderRepository;
    //调用接口方法添加汽车id和userName到订单表
    public void insertOrder(Order order) {
        orderRepository.insertOrder(order);
    }
    //查询订单表
    public Order selectOrderByUserName(String userName){
        return orderRepository.selectOrderByUserName(userName);
    }
    //删除订单
    public void deleteOrderByUserName(String userName){
        orderRepository.deleteOrderByUserName(userName);
    }
    public Order selectAllOrder(){
        return orderRepository.selectAllOrder();
    }
}
